package com.changgou.search.listener;

import com.changgou.search.service.ESManagerService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

//@Component
public class SearchListener {
    @Autowired
    private ESManagerService esManagerService;

    @RabbitListener(queues = "search_update_queue")
    public void updateSkuBySpuID(String spuid){
        esManagerService.importData2ESBySpuId(spuid);
    }
    @RabbitListener(queues = "search_del_queue")
    public void deleteSkuBySpuID(String spuid){
        esManagerService.deleteData2ESBySpuId(spuid);
    }
}
